package com.itheima.web.controller;

import com.itheima.web.service.BlogService;
import com.itheima.web.service.impl.BlogServiceImpl;
import com.itheima.xo.common.Result;
import com.itheima.xo.pojo.Blog;
import com.itheima.xo.vo.BlogVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @author :WuJunJie
 * packageName :com.itheima.web.controller
 * fileName :BlogController
 * creationTime :2022-11-07 15:19
 */
@RestController
@RequestMapping("blog")
@Slf4j
public class BlogController {
    @Autowired
    @Qualifier("aaa")
    private BlogService blogService;
//    private BlogService blogService;


    @GetMapping("findAll")
    public Result findAll(){
        ArrayList<BlogVo> all = blogService.findAll();
        return Result.success(all);
    }

}
